import MainPage from "@/pages/MainPage/MainPage.vue";

const routes = [
    {
        //path 代表的是路径
        //name 路由的名称
        //title 页面的标题
        //component 对应组件的名称
        path: '/',
        name: 'index',
        title: '首页',
        component: MainPage
    },
    {
        path: '/login',
        name: 'login',
        title: '登陆',
        component: () => import('@/pages/LoginPage/StarSky.vue')
    },
    {
        path: '/register',
        name: 'register',
        title: '注册',
        component: () => import('@/pages/RegisterPage/StarSkyPage.vue')
    },
    {
        path: '/dashboard',
        name: 'dashboard',
        title: '数据页面',
        component: () => import('@/pages/View/DashBoard.vue'),
        meta: {
            requireAuth: true
        }
    },
    {
        path: '/editp',
        name: 'editproduct',
        title: '编辑产品',
        component: () => import('@/pages/View/EditProduct.vue'),
        meta: {
            requireAuth: true
        }
    },
    {
        path: '/addp',
        name: 'addproduct',
        title: '添加产品',
        component: () => import('@/pages/View/AddProduct.vue'),
        meta: {
            requireAuth: true
        }
    },
    {
        path: '/editu',
        name: 'edituser',
        title: '编辑用户',
        component: () => import('@/pages/View/EditUser.vue'),
        meta: {
            requireAuth: true
        },
    },
    {
        path: '/addu',
        name: 'adduser',
        title: '添加用户',
        component: () => import('@/pages/View/AddUser.vue'),
        meta: {
            requireAuth: true
        }
    },
    {
        path: '/self',
        name: 'selflist',
        title: '个人中心',
        component: () => import('@/pages/View/selfList.vue'),
        meta: {
            requireAuth: true
        }
    },

]
export default routes;
